package gameam.data;

import java.sql.*;
//import BusinessLayer.*;
public class AccessTest{
  public static void main(String [] args) {
    Connection con = null;
    try {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;

	  String databaseDriver = args[0];
	  System.out.println(databaseDriver);
// Connect with a url string
      con = DriverManager.getConnection("jdbc:odbc:"+databaseDriver);
      System.out.println("Connection ok.");
	  
	  Statement sta = con.createStatement();
	  
	  ResultSet res = sta.executeQuery("SELECT * FROM TBLQUESTIONS");
	  System.out.println("List of questions: "); 
      
	  while (res.next()) 
	  {
         System.out.println(
           "  "+res.getInt("ID")
           + ", "+res.getString("Question")
           + ", "+res.getString("IsZeroFloored"));
      }
      res.close();

      sta.close();
      con.close(); 

    } catch (Exception e) {
      System.err.println("Exception: "+e.getMessage());
    }
  }
}